<?php

function api_page($m)
{
    $page = input('page',1,'int');
    $limit = input('limit',10,'int');
    $m->limit(($page-1)*$limit,$limit);
    return $m->select();
}

function get_image($image)
{
    $image = explode(',',$image);
    foreach ($image as  $k => $v)
    {
        $image[$k] = cdnurl($v,true);
    }
    return $image;
}

function get_provincial($address)
{
    $address = urldecode($address);
    $id =  \think\Db::name('provincial')->where('name',$address)->value('id');
    return $id;
}